package com.example.share.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.share.mapper.UserMapper;
import com.example.share.pojo.User;
import com.example.share.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MyServiceImpl implements MyService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User finduser( String name ){
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        //查询名字为 Tom 的一条记录
        queryWrapper.eq("user_name",name);
        User user = userMapper.selectOne(queryWrapper);
        System.out.println(user);
        return user;
    }
    @Override
    public User finduser(int userId) {
        return null;
    }
}
